extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "羽月"                   # 角色的名称
	attCoe.atkRan = 2                 # 攻击距离
	attCoe.maxHp = 6                  # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 7                   # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 3                 # 魔法攻击（每点代表13.7）
	attCoe.def = 4                    # 物理防御（每点代表15）
	attCoe.mgiDef = 4                 # 魔法防御（每点代表16.6）
	atkEff = "atk_dao" 
	xb = "火"
	lv = 4    
	addSkillTxt("[炎切]以敏捷的动作戏弄对手后进行切斩，造成150%物攻加成的火属性物理伤害\n命中身上有<灼烧>的目标则提升25%暴伤，最高提升100%[CD:10]")
	addSkillTxt("[一文字烧]用剑锋划出一的火焰文字攻击目标，造成100%火属性物理伤害并附带5层<灼烧>[CD:7]")
	addSkillTxt("[红玉剑击]通过华丽的剑击攻击目标，造成180%物攻的火属性物理伤害，可暴击，若暴击物攻提升10%，最高60%[CD:15]")
	addSkillTxt("[color=#FFFF00][赤焰冲天][/color]:[color=#FFCC22]赤焰之力吞噬目标亚比，造成200%物攻的火属性物理伤害，可暴击\n若目标身上有<灼烧>且此次伤害没有暴击时，则必定暴击[CD:18][/color]")
	addCdSkill("yanqie",10) 
	addCdSkill("yiwenzi",7)
	addCdSkill("hongyu",15)
	addCdSkill("chiyan",18)


func _castCdSkill(id):
	._castCdSkill(id)
	if id == "yanqie":
		if aiCha.hasBuff("zhuoshao") !=null:
			var eff = sys.newEff("numHit", position, false, 1)
			eff.setText("爆炎切", "#FF0099")
			eff.anim.set_speed_scale(0.2)
			typeHurtCha(aiCha,att.atk*1.5,Chara.HurtType.PHY,Chara.AtkType.SKILL,"火")
			var buff = hasBuff("yanqiebf")
			if buff == null:
				addBuff(yanqiebf.new())
			elif buff.att.criR < 1:
				buff.att.criR += 0.25
		else:
			typeHurtCha(aiCha,att.atk*1.2,Chara.HurtType.PHY,Chara.AtkType.SKILL,"火")
	if id == "yiwenzi":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("一文字烧", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,att.atk*1.2,Chara.HurtType.PHY,Chara.AtkType.SKILL,"火")
		aiCha.addBuff(bf.zhuoshao.new(5))
	if id == "hongyu":
		if atkInfo.isCri:
			var eff = sys.newEff("numHit", position, false, 1)
			eff.setText("真红玉剑击", "#FF0099")
			eff.anim.set_speed_scale(0.2)
			typeHurtCha(aiCha,att.atk*1.8,Chara.HurtType.PHY,Chara.AtkType.NORMAL,"火")
			var buff = hasBuff("wugong1")
			if buff == null:
				addBuff(bf.wugong1.new())
			elif buff.att.atkL < 0.6:
				buff.att.atkL += 0.1
		else:
			typeHurtCha(aiCha,att.atk*1.8,Chara.HurtType.PHY,Chara.AtkType.NORMAL,"火")
	if id == "chiyan":
		if aiCha.hasBuff("zhuoshao") !=null && atkInfo.isCri == false:
			var eff = sys.newEff("numHit", position, false, 1)
			eff.setText("真赤焰冲天", "#FF0099")
			eff.anim.set_speed_scale(0.2)
			typeHurtCha(aiCha,att.atk*(2+att.criR)*2,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		else:
			typeHurtCha(aiCha,att.atk*2,Chara.HurtType.PHY,Chara.AtkType.NORMAL)



func _onAtkInfo(atkInfo):
	._onAtkInfo(atkInfo)
	if atkInfo.atkCha == self && atkInfo.atkType == Chara.AtkType.NORMAL:
		atkInfo.canCri = true

class yanqiebf:
	extends Buff
	func _init():
		attInit()
		var dispelable = false
		id = "yanqiebf"	
		att.criR = 0.25
